import 'package:flutter/material.dart';
import 'package:loading_indicator/loading_indicator.dart'; // 确保你已添加 loading_indicator 包

class LoadingSpinner extends StatelessWidget {
  final double size; // 可自定义大小
  final List<Color> colors; // 可自定义颜色

  const LoadingSpinner({
    Key? key,
    this.size = 50.0, // 默认大小
    this.colors = const [
      Color.fromRGBO(62, 168, 244, 1),
      Color.fromRGBO(254, 131, 90, 1),
      Color.fromRGBO(0, 194, 187, 1),
      Color.fromRGBO(122, 93, 177, 1),
    ],
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        width: size,
        height: size,
        child: LoadingIndicator(
          indicatorType: Indicator.ballRotateChase,
          colors: colors, // 直接使用 colors
        ),
      ),
    );
  }
}
